package sys.model;

import com.util.DateUtil;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

public class AnserKey {
    private Integer id;    //id

    private Integer qid;   //  问卷id

    private Date ctime;   //  创建时间

    private String username;  //  用户名

    private String useragent;   //   用户终端

    private List<Anser> anserList;  //  单题答案 list
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getQid() {
        return qid;
    }

    public void setQid(Integer qid) {
        this.qid = qid;
    }

    public Timestamp getCtime() {
        return new Timestamp(ctime.getTime())  ;
    }

    public void setCtime(Date ctime) {
        this.ctime = ctime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getUseragent() {
        return useragent;
    }

    public void setUseragent(String useragent) {
        this.useragent = useragent == null ? null : useragent.trim();
    }

    public List<Anser> getAnserList() {
        return anserList;
    }

    public void setAnserList(List<Anser> anserList) {
        this.anserList = anserList;
    }

    public String getCtimeToFullString(){
        return DateUtil.DateToFullString(ctime);
    }
    public String toString() {

            return "问卷答案{" +
                    "id=" + id +
                    ", 问卷id='" + qid + '\'' +
                    ", 创建时间='" + getCtimeToFullString() + '\'' +
                    ", 用户名='" + username + '\'' +
                    ", 用户终端='" + useragent +'\''+
                    ", \n答案=" + anserList +"\n"+
                    '}';
        }

}